<template>
  <div class="community views-container">
    <div class="wlm-table">

      <div class="wlm-table-header">
        <el-form :model="tableFormatData.settleList.files" size="small" label-width="100px" class="retail-form" label-position="right">
          <el-form-item label="供应商名称：" class="search">
            <el-input v-model="tableFormatData.settleList.files.name" placeholder="请输入供应商名称" style="width:170px;"></el-input>
          </el-form-item>
          <el-form-item label="" class="filter-btns">
            <el-button v-waves type="primary" @click="filesSerch">筛选</el-button>
            <el-button type="text" @click="filesEmpty">清空筛选条件</el-button>
          </el-form-item>
        </el-form>
      </div>
      <div class="wlm-table-content">
        <el-table :ref="tableFormatData.settleList.key" :data="tableFormatData.settleList.tableData" @selection-change="handleSelectionChange" style="width: 100%">
          <!-- <el-table-column type="selection" width="55">
                </el-table-column> -->
          <!-- <el-table-column prop="ID" type="index">
          </el-table-column> -->
          <el-table-column prop="supplier" label="供应商" width="200px">
            <template slot-scope="scope">
              <div style="display:flex;justify-conten:center;align-items:center;">
                <img height="50" width="50" :src="scope.row.logo[0].file_path" alt="这是图片" style="border-radius:50%;marign-right:10px;vertical:middle;">
                <span>{{scope.row.name}}</span>
              </div>

            </template>
          </el-table-column>
          <el-table-column prop="logo" label="销售数据">
            <template slot-scope="scope">
             <div>订单数量：{{scope.row.order_num}}(共{{scope.row.goods_num}}件商品)</div>
             <div>实付金额：{{scope.row.pay_price}}</div>
             <!-- <div>结算费率{{scope.row.sellData.settleRate}}</div> -->
             <div>平台所得：{{scope.row.p_money}}</div>
             <div>团长所得：{{scope.row.reg_money}}</div>
            </template>
          </el-table-column>
          <el-table-column prop="supplier_money" label="供应商所得">
          </el-table-column>
          <el-table-column prop="is_bill_money" label="已结算金额">
          </el-table-column>
          <el-table-column prop="no_bill_money" label="未结算金额">
          </el-table-column>
          <!-- <el-table-column prop="time" label="上次结算时间">
          <template slot-scope="scope">
              <span>{{ scope.row.time*1000 | parseTime('{y}-{m}-{d} {h}:{i}:{s}') }}</span>
            </template>
          </el-table-column> -->
          <el-table-column label="操作">
            <template slot-scope="scope">
              <div class="operation-group">
                <router-link class="wlm-text" tag="span" :to="{path:'/application/settleManagementDetail', query:{s_id:scope.row.s_id,path:scope.row.logo[0].file_path,name:scope.row.name}}">
                  <el-button type="text">详情</el-button>
                </router-link>

              </div>
            </template>
          </el-table-column>
        </el-table>
        <div class="pagination-content flex-row flex-justify-e flex-align-c">
          <el-pagination :disabled="!hasTableData" @size-change="listPageChange" @current-change="listPageChange" :current-page.sync="tableFormatData.settleList.pagination.page" :page-sizes="tableFormatData.settleList.pagination.pagesizes" :page-size.sync="tableFormatData.settleList.pagination.list_rows" layout="total, sizes, prev, pager, next, jumper" :total="hasTableData?tableFormatData.settleList.pagination.total : 0">
          </el-pagination>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { regBill } from '@/api/commityBuy'
import waves from '@/directive/waves' // Waves directive
import mixins from '@/mixins/mixins'
export default {
  mixins: [mixins.getters('Table')],
  name: 'Settle',
  components: {

  },
  directives: {
    waves
  },
  data() {
    return {
      tableFormatData: {
        current: 'settleList',
        settleList: {
          key: 'settleList',
          api: {
            getList: regBill
          },
          tableData: [],
          files: {
            name: '',
            ids: [],
            checkall: '0'
          },
          pagination: {
            page: 1,
            list_rows: 10,
            pagesizes: [10, 20, 50],
            total: 0
          }
        }
      }
    }
  },
  methods: {

  }
}
</script>

